package edu.sctu.lab03;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//类名的后缀是xxxxServlet
//一般情况下，这个类继承了HttpServlet
// 一般情况下，会重写---doGet(),
//                  ---doPost()
public class IndexServlet extends HttpServlet {
    @Override//重写
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
             super.doGet(request, response);
             //如何得到out这个变量？
        PrintWriter out=response.getWriter();

        out.write("<h1>hello,servlet!</h1>");

//web.xml中配置servlet类名
        //web.xml中配置

    }
}
